package com.piggy.auth.controller;

import com.piggy.common.core.constant.SecurityConstants;
import com.piggy.common.core.domain.R;
import com.piggy.sys.api.RemoteSmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * token 控制
 *
 * @author shark
 */
@Api(value="运营系统",tags = {"登录认证"})
@RestController
@RequiredArgsConstructor
@RequestMapping("/oauth/sms")
public class SysSmsController
{

    @Resource
    private RemoteSmsService smsService;

    /**
     * 令牌管理调用
     * @return
     */
    @ApiOperation("发送验证码")
    @GetMapping("/regSms")
    public R<Boolean> send(@RequestParam("phone") String phone) {
        return smsService.userRegSendSms(phone, SecurityConstants.INNER);
    }

}
